home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PASCSRC.ZIP / CASEDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-15  |  634b  |  20 lines

  1.                                 (* Chapter 4 - Program 8 *)
  2. program Demonstrate_Case;
  3.  
  4. var Count : integer;
  5.  
  6. begin  (* main program *)
  7.    for Count := 0 to 8 do begin
  8.       Write(Count:5);
  9.          case Count of
  10.            1 : Write(' One');    (* Note that these do not have *)
  11.            2 : Write(' Two');    (* to be in consecutive order *)
  12.            3 : Write(' Three');
  13.            4 : Write(' Four');
  14.            5 : Write(' Five');
  15.          else Write(' This number is not in the allowable list');
  16.          end; (* of case structure *)
  17.       Writeln;
  18.    end;  (* of Count loop *)
  19. end.  (* of main program *)
  20.